package com.JL.engine.components;

import com.JL.engine.model.Component;
import com.JL.engine.model.View;

import java.awt.*;
import java.util.concurrent.ConcurrentLinkedQueue;

public class ViewComponent extends Component {
    private ConcurrentLinkedQueue<View> views = new ConcurrentLinkedQueue<>();

    public void addView(View view){
        views.add(view);
    }

    public void removeView(View view){
        views.remove(view);
    }

    public void draw(Graphics g){
        for(View view : views){
            view.draw(g, this.entity);
        }
    }
}
